/** * Minified by jsDelivr using Terser v3.14.1. * Original file: /npm/promise-polyfill@8.1.3/lib/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ "use strict";function finallyConstructor(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})}var setTimeoutFunc=setTimeout;function isArray(e){return Boolean(e&&void 0!==e.length)}function noop(){}function bind(e,n){return function(){e.apply(n,arguments)}}function Promise(e){if(!(this instanceof Promise))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(e,this)}function handle(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,Promise._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var r;try{r=t(e._value)}catch(e){return void reject(n.promise,e)}resolve(n.promise,r)}else(1===e._state?resolve:reject)(n.promise,e._value)})):e._deferreds.push(n)}function resolve(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if(n instanceof Promise)return e._state=3,e._value=n,void finale(e);if("function"==typeof t)return void doResolve(bind(t,n),e)}e._state=1,e._value=n,finale(e)}catch(n){reject(e,n)}}function reject(e,n){e._state=2,e._value=n,finale(e)}function finale(e){2===e._state&&0===e._deferreds.length&&Promise._immediateFn(function(){e._handled||Promise._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n